import { Button } from "antd";
import { LinkOutlined } from "@ant-design/icons";
import { memo } from "react";
import { useNavigate } from "react-router-dom";

const TaskModification = ({ userId }: { userId: number }) => {
  const navigate = useNavigate();
  const handleNavigateToModification = () => {
    // 正确格式化动态路由
    navigate(`/home/workplace/taskExamination/${userId}`);
  };

  return (
    <Button
      icon={<LinkOutlined />}
      size="small"
      type="link"
      style={{ gap: "2px" }}
      onClick={handleNavigateToModification}
    >
      修改任务详情
    </Button>
  );
};
export default memo(TaskModification);
